package cn.fj.hrm.client;
import cn.fj.hrm.basic.util.JsonResult;
import cn.fj.hrm.document.CourseDoc;
import cn.fj.hrm.fallback.ElasticSearchClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(value = "SERVICE-SEARCH",fallbackFactory = ElasticSearchClientFallbackFactory.class)
public interface ElasticSearchClient {

    /**
     * 批量添加或者修改
     * @param courseDocList
     * @return
     */
    @PostMapping("/search/saveBatch")
    JsonResult saveBatch(@RequestBody List<CourseDoc> courseDocList);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    @DeleteMapping("/search/deleteByIds")
    JsonResult deleteByIds(@RequestBody List<Long> ids);
}
